package org.fisco.bcos.asset.service.impl;


import java.math.BigInteger;

import lombok.SneakyThrows;
import org.fisco.bcos.asset.client.CharityDonationClient;

import org.fisco.bcos.asset.resp.DonorRecord;
import org.fisco.bcos.asset.service.DonorService;
import org.fisco.bcos.sdk.model.TransactionReceipt;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class DonorServiceImpl extends CharityServiceImpl implements DonorService {

    @Autowired
    private CharityDonationClient charityDonationClient;

    @Override
    public DonorRecord donate(BigInteger projectId, BigInteger amount) {
        return charityDonationClient.donate(projectId, amount);
    }

    @SneakyThrows
    @Override
    public BigInteger getDonationAmount(BigInteger projectId, String donorAddress) {
        return charityDonationClient.getDonationAmount(projectId, donorAddress);
    }
}